package com.yuandian.api.business_monitor.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.yuandian.utils.YDateUtil;

import java.io.Serializable;

/**
 * <p>
 * 告警业务导出excelVO
 * </p>
 *
 * @author fucx
 * @since 2020-11-10
 */
// @Data 这里不使用，导出excel文件前要计算
@HeadRowHeight(30)
public class BusiDetailExcelVo implements Serializable {

	/**
	 *
	 */
	@ExcelIgnore
	private static final long serialVersionUID = 1L;

	/**
	 * 序号
	 */
	private Integer number;

	/**
	 * 系统名称
	 */
	@ExcelIgnore
	private String systemName;
	/**
	 * 业务名称
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "业务名称")
	private String businessName;

	/**
     * 告警类型名称
     */
	@ColumnWidth(20)
	@ExcelProperty(value = "告警类型")
    private String alarmTypeName;

	/**
	 * 访问量
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "访问量")
	private Long visitCountTotal;

	/**
	 * 完整访问量
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "完整访问量")
	private Long completeVisitTotal;

	/**
	 * 平均办理时长
	 */
	@ColumnWidth(20)
	@ExcelIgnore
	private Long avgDealTime;

	/**
	 * 平均办理时长
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "平均办理时长")
	private String avgDealTimeFormat;


	/**
	 * 失败访问量
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "失败访问量")
	private Long visitsFailTotal;

	/**
	 * 成功率
	 */
	@ColumnWidth(20)
	@ExcelIgnore
	private Double successRatio;

	/**
	 * 成功率
	 */
	@ColumnWidth(20)
	@ExcelProperty(value = "成功率")
	private String successRatioFormat;


	public String getBusinessName() {
		return businessName;
	}

	public void setBusinessName(String businessName) {
		this.businessName = businessName;
	}

	public Long getVisitCountTotal() {
		return visitCountTotal;
	}

	public void setVisitCountTotal(Long visitCountTotal) {
		this.visitCountTotal = visitCountTotal;
	}

	public Long getCompleteVisitTotal() {
		return completeVisitTotal;
	}

	public void setCompleteVisitTotal(Long completeVisitTotal) {
		this.completeVisitTotal = completeVisitTotal;
	}

	public Long getAvgDealTime() {
		return avgDealTime;
	}

	public void setAvgDealTime(Long avgDealTime) {
		this.avgDealTime = avgDealTime;
	}

	public String getAvgDealTimeFormat() {
		if (avgDealTime != null) {
			return YDateUtil.getMinSecond((double) avgDealTime / 1000);
		}
		return avgDealTimeFormat;
	}

	public void setAvgDealTimeFormat(String avgDealTimeFormat) {
		this.avgDealTimeFormat = avgDealTimeFormat;
	}

	public Long getVisitsFailTotal() {
		return visitsFailTotal;
	}

	public void setVisitsFailTotal(Long visitsFailTotal) {
		this.visitsFailTotal = visitsFailTotal;
	}

	public Double getSuccessRatio() {
		return successRatio;
	}

	public void setSuccessRatio(Double successRatio) {
		this.successRatio = successRatio;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getSuccessRatioFormat() {
		String format = "";
		if (successRatio != null) {
			if("0.0".equals(String.valueOf(successRatio))) {
				format = "0.00%";
			}else if("100.0".equals(String.valueOf(successRatio))) {
				format = "100.00%";
			}else {
				format = successRatio + "%";
			}
		}

		return format;
	}

	public void setSuccessRatioFormat(String successRatioFormat) {
		this.successRatioFormat = successRatioFormat;
	}

	public String getAlarmTypeName() {
		return alarmTypeName;
	}

	public void setAlarmTypeName(String alarmTypeName) {
		this.alarmTypeName = alarmTypeName;
	}

	public void setNumber(Integer number) {
		this.number = number;
	}

	public Integer getNumber() {
		return number;
	}

	public void setSystemName(String systemName) {
		this.systemName = systemName;
	}

	public String getSystemName() {
		return systemName;
	}



}
